﻿using Model.BusinessModel;
using Model.BusinessModel.InPut;
using Model.BusinessModel.OutPut;
using Model.BusinessModel.OutPut.sys;
using Model.DomainModel.Sys;
using Utility;

namespace DomainService.IService.Sys
{
    /// <summary>
    /// 用户服务接口
    /// </summary>
    public interface ISysUserService
    {
        /// <summary>
        /// 根据条件获取用户
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <param name="departmentId">部门key</param>
        /// <returns></returns>
        ReceiveStatus<SysUserOutPut> GetUser(string corporationKey, string? departmentId);

        /// <summary>
        /// 获取公司人员
        /// </summary>
        /// <param name="pageResultModel"></param>
        /// <returns></returns>
        PageResultModel<SysUserOutPut> GetCorporationUser(PageResultModel pageResultModel);

        /// <summary>
        /// 根据用户名称和密码获取用户信息
        /// </summary>
        /// <param name="userName">用户名称</param>
        /// <param name="password">用户密码</param>
        /// <param name="corporationKey">公司key</param>
        /// <param name="systemKey">系统key</param>
        /// <returns></returns>
        ReceiveStatus<LoginOutPut> GetUserMsg(string userName, string password, string corporationKey, string systemKey);

        /// <summary>
        /// 新增用户
        /// </summary>
        /// <param name="sysUser">用户数据</param>
        ReceiveStatus Insert(SysUser sysUser);

        /// <summary>
        /// 修改用户
        /// </summary>
        /// <param name="sysUser">用户数据</param>
        ReceiveStatus Update(SysUser sysUser);

        /// <summary>
        /// 设置用户是否启用
        /// </summary>
        /// <param name="updateIsOpenInPut">修改模型</param>
        /// <returns></returns>
        ReceiveStatus SetUserIsOpen(UpdateIsOpenInPut updateIsOpenInPut);

        /// <summary>
        /// 设置用户角色
        /// </summary>
        /// <param name="userOrRoleInput">传入模型</param>
        /// <param name="userId">修改用户id</param>
        ReceiveStatus SetUserRole(UserRoleInput userOrRoleInput, string userId);

        /// <summary>
        /// 根据用户id获取对应角色
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="corporationKey">公司key</param>
        /// <returns>返回用户所属角色key</returns>
        ReceiveStatus<int> GetUserRole(string userId, string corporationKey);

        /// <summary>
        /// 获取公司人员
        /// </summary>
        /// <param name="corporationKey"></param>
        /// <returns></returns>
        ReceiveStatus<TreeOutPut> GetCorporationUser(string corporationKey);

        /// <summary>
        /// 获取绑定用户
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="corporationKey"></param>
        /// <returns></returns>
        ReceiveStatus<string> GetBindUser(int roleId, string corporationKey);

        /// <summary>
        /// 根据公司key,获取用户
        /// </summary>
        /// <param name="ids">部门id集合</param>
        /// <returns></returns>
        ReceiveStatus<SelectOutPut> GetUserByCorporationKey(string corporationKey);


        /// <summary>
        /// 获取所有用户
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <returns></returns>
        ReceiveStatus<SysUser> GetAllUser(string corporationKey);
    }
}
